var $ = require('../../../utils/helper.js'), that = null
var app = getApp()
Page({
  data: {
    error_code:999,
    time:0,
  },
  onLoad(e) {
    that = this
  },
  onShow: function () {
    let time =parseInt(Date.parse(new Date())/1000);
    that.setData({time:time})
    $.check(that)
  },
  onReady: function () {

  },
  init: function () {
    $.post("api/auth/get", null, function (auth){
      that.setData({auth:auth})
      that.setData({ error_code: 0 })
    },function(message,error_code){
      that.setData({error_code:error_code})
    })
    $.post("api/service/user_get",null,function(data){
      that.setData({service:data})
    })
    $.post("api/signup/user_get", null, function (data) {
      that.setData({signup:data})
    })
  },
  reset:function(){
    wx.navigateTo({
      url: '/pages/user/auth/index',
    })
  },
  topay:function(e){
    wx.navigateTo({
      url: '/pages/order/pay/index?pro=' + e.currentTarget.dataset.pro,
    })
  }
}) 